import { createRouter, createWebHashHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
	history: createWebHashHistory(),
	routes: [
		{
			path: "/",
			name: "home",
			component: HomeView
		},
		{
			path: '/login',
			name: 'login',
			component: () => import("../views/LoginView.vue")
		},
		{
			path: "/admin",
			name: "admin",
			component: () => import("../views/AdminView.vue"),
			children: [
				{
					path: 'home',
					name: 'home',
					// route level code-splitting
					// this generates a separate chunk (About.[hash].js) for this route
					// which is lazy-loaded when the route is visited.
					component: () => import('../views/admin/HomeView.vue')
				},
				{
					path: 'db',
					name: 'db',
					// route level code-splitting
					// this generates a separate chunk (About.[hash].js) for this route
					// which is lazy-loaded when the route is visited.
					component: () => import('../views/admin/DBView.vue')
				},
				{
					path: 'group',
					name: 'group',
					// route level code-splitting
					// this generates a separate chunk (About.[hash].js) for this route
					// which is lazy-loaded when the route is visited.
					component: () => import('../views/admin/GroupView.vue')
				},
				{
					path: 'glive',
					name: 'glive',
					// route level code-splitting
					// this generates a separate chunk (About.[hash].js) for this route
					// which is lazy-loaded when the route is visited.
					component: () => import('../views/admin/GroupLiveStreamView.vue')
				}
			]
		}
	]
})

export default router


